package com.czxy.demo10;

import java.util.ArrayList;

public class Test01 {
    public static void main(String[] args) {

        String[] str = {"12","345","6789","1","123","4567"};
        ArrayList<String> list1 = new ArrayList<>();
        ArrayList<String> list2 = new ArrayList<>();
        for (String s : str) {
            if (s.length()%2==0){
                list1.add(s);
            }else {
                list2.add(s);
            }
        }
        System.out.println("偶数长度字符串 :"+list1);
        System.out.println("奇数长度字符串 :"+list2);
    }
}
